package org.ali.creationalpattern.abstractfactorypattern.factory;

import org.ali.creationalpattern.abstractfactorypattern.color.Color;
import org.ali.creationalpattern.abstractfactorypattern.color.Green;
import org.ali.creationalpattern.abstractfactorypattern.color.Red;
import org.ali.creationalpattern.abstractfactorypattern.shape.Shape;

/**
 * 颜色工厂
 */
public class ColorFactory implements Factory {
    @Override
    public Color getColor(String message) {
        return switch (message) {
            case "Red" -> new Red();
            case "Green" -> new Green();
            default -> null;
        };
    }

    @Override
    public Shape getShape(String message) {
        return null;
    }
}
